package git.bankview.wl.report;

import java.util.*;
import java.text.*;
import java.io.*;

import laya.semi.process.*;

import git.bankview.sl.db.*;
import git.bankview.sl.report.ReportCommon;

import org.apache.log4j.Logger;

public class JasperLoadActivity
	implements IGenericClassActivity
{
	private static Logger log = Logger.getLogger(JasperLoadActivity.class);

	public void execute(IProcessContext oCtx)
		throws Exception
	{
		String[] params = oCtx.getActivityParameter().split(":");
		String toField = params[0];
		String fromName = params[1];
		
		String oTransid = (String)oCtx.getField("transid");
		
		File dest = new File(ReportCommon.JASPER_DIR + oTransid + "/" + fromName);
		if (!dest.exists())
		{
			throw new ActivityException(oCtx, "jasperStore.err.fileNotExists");
		}
		
		oCtx.setField(toField, dest);
	}
}
